package com.seuic.hnjiningposapp.hnapps.ui.view.dialog;

import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.BasePopupView;
import com.seuic.hnjiningposapp.R;
import com.seuic.hnjiningposapp.hnapps.util.GetMoneyLvUtils;
import com.socks.library.KLog;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 确认定转活信息
 */
public class SureDtoHinfoPp extends BasePopupView {
    @BindView(R.id.sure_switchinfo_type)
    TextView sureSwitchinfoType;
    @BindView(R.id.sure_switchinfo_numtext)
    TextView sureSwitchinfoNumtext;
    @BindView(R.id.sure_username)
    TextView sureUsername;
    @BindView(R.id.sure_pennum)
    TextView surePennum;
    @BindView(R.id.sure_switchinfo_name)
    TextView sureSwitchinfoName;
    @BindView(R.id.sure_in)
    TextView sureIn;
    @BindView(R.id.sure_totag)
    TextView sureTotag;
    @BindView(R.id.sure_switchinfo_valuedate)
    TextView sureSwitchinfoValuedate;
    @BindView(R.id.sure_endtime)
    TextView sureEndtime;
    @BindView(R.id.sure_switchinfo_moneytext)
    TextView sureSwitchinfoMoneytext;
    @BindView(R.id.sure_switchinfo_getmoney)
    TextView sureSwitchinfoGetmoney;
    @BindView(R.id.sure_switchinfo_gettag)
    TextView sureSwitchinfoGettag;
    @BindView(R.id.sure_switchinfo_getawaymoney)
    TextView sureSwitchinfoGetawaymoney;

    @BindView(R.id.sure_switchinfo_yesbtn)
    Button sureSwitchinfoYesbtn;
    Unbinder bind;

    String sureSwitchinfoTypes;
    String sureSwitchinfoNumtexts;
    String sureUsernames;
    String surePennums;
    String sureSwitchinfoNames;
    String sureIns;
    String sureTotags;
    String sureSwitchinfoValuedates;
    String sureEndtimes;
    String sureSwitchinfoMoneytexts;
    String sureSwitchinfoGetmoneys;
    String sureSwitchinfoGettags;
    String sureSwitchinfoGetawaymoneys;
    String FS_MNG_FLG;

    public String getFS_MNG_FLG() {
        return FS_MNG_FLG;
    }

    public void setFS_MNG_FLG(String FS_MNG_FLG) {
        this.FS_MNG_FLG = FS_MNG_FLG;
    }

    public void setSureSwitchinfoTypes(String sureSwitchinfoTypes) {
        this.sureSwitchinfoTypes = sureSwitchinfoTypes;
    }

    public void setSureSwitchinfoNumtexts(String sureSwitchinfoNumtexts) {
        this.sureSwitchinfoNumtexts = sureSwitchinfoNumtexts;
    }

    public void setSureUsernames(String sureUsernames) {
        this.sureUsernames = sureUsernames;
    }

    public void setSurePennums(String surePennums) {
        this.surePennums = surePennums;
    }

    public void setSureSwitchinfoNames(String sureSwitchinfoNames) {
        this.sureSwitchinfoNames = sureSwitchinfoNames;
    }

    public void setSureIns(String sureIns) {
        this.sureIns = sureIns;
    }

    public void setSureTotags(String sureTotags) {
        this.sureTotags = sureTotags;
    }

    public void setSureSwitchinfoValuedates(String sureSwitchinfoValuedates) {
        this.sureSwitchinfoValuedates = sureSwitchinfoValuedates;
    }

    public void setSureEndtimes(String sureEndtimes) {
        this.sureEndtimes = sureEndtimes;
    }

    public void setSureSwitchinfoMoneytexts(String sureSwitchinfoMoneytexts) {
        this.sureSwitchinfoMoneytexts = sureSwitchinfoMoneytexts;
    }

    public void setSureSwitchinfoGetmoneys(String sureSwitchinfoGetmoneys) {
        this.sureSwitchinfoGetmoneys = sureSwitchinfoGetmoneys;
    }

    public void setSureSwitchinfoGettags(String sureSwitchinfoGettags) {
        this.sureSwitchinfoGettags = sureSwitchinfoGettags;
    }

    public void setSureSwitchinfoGetawaymoneys(String sureSwitchinfoGetawaymoneys) {
        this.sureSwitchinfoGetawaymoneys = sureSwitchinfoGetawaymoneys;
    }

    SureDtoHCallBack mSureDtoHCallBack;

    public SureDtoHinfoPp(@NonNull Context context, SureDtoHCallBack sureDtoHCallBack) {
        super(context);

        this.mSureDtoHCallBack = sureDtoHCallBack;
    }

    @Override
    protected int getPopupLayoutId() {
        return R.layout.sure_dtoh_info_layout;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        bind = ButterKnife.bind(this);
        sureSwitchinfoType.setText(sureSwitchinfoTypes);//交易类型
        sureSwitchinfoNumtext.setText(sureSwitchinfoNumtexts);//银行账号
        sureUsername.setText(sureUsernames);//客户姓名
        surePennum.setText(surePennums);//笔号
        sureSwitchinfoName.setText(sureSwitchinfoNames);//产品名称
        sureIn.setText(sureIns);//利率
        if (FS_MNG_FLG.equals("1")){
            if (sureTotags.equals("1")) {
                sureTotag.setText("本息转存");//转存标志
            } else if (sureTotags.equals("2")) {
                sureTotag.setText("本金转存");//转存标志
            }
        }else {
            sureTotag.setText("非自动转存");//转存标志
        }

        sureSwitchinfoValuedate.setText(sureSwitchinfoValuedates);//起息日
        sureEndtime.setText(sureEndtimes);//到期日期
        sureSwitchinfoMoneytext.setText(sureSwitchinfoMoneytexts);//账户余额
        sureSwitchinfoGetmoney.setText(sureSwitchinfoGetmoneys);//支取金额
        sureSwitchinfoGettag.setText(sureSwitchinfoGettags);//支取类别
        sureSwitchinfoGetawaymoney.setText(sureSwitchinfoGetawaymoneys);//支取后余额

    }

    @OnClick({R.id.sure_switchinfo_yesbtn})
    public void onViewClicked(View view) {
        switch (view.getId()) {

            case R.id.sure_switchinfo_yesbtn:
                mSureDtoHCallBack.SureDtoHNext();
                break;
        }
    }

    public interface SureDtoHCallBack {

        void SureDtoHNext();
    }

    @Override
    protected void onDismiss() {
        super.onDismiss();
        //注解解绑
        if (bind != null && bind != Unbinder.EMPTY) {
            bind.unbind();
        }
        this.bind = null;
    }


}
